package FinalAirportManagerSystem;

import AirportInfomations.AirportInfo;
import AirportInfomations.ContorllerIformation;
import FlightInfo.FlightStatus;
import FlightInfo.Flights;
import NewAirportInfo.AirportBasicInfo;
import NewAirportInfo.AirportRunwayInfo;
import UserInterface.*;

import java.util.ArrayList;
import java.util.Scanner;


public final class FinalAMSystem {
    public boolean FinalAMSystem() {
        boolean flag = true;

        ArrayList<AirportBasicInfo>Airports = new ArrayList<>();//全局机场变量
        ArrayList<Flights>AllOfFlights=new ArrayList<>();//全局航班信息变量
        ArrayList<FlightStatus>AllOfFlightStatus=new ArrayList<>();//全局航班状态
        ContorllerIformation ContorllerIformation = new ContorllerIformation();//全局机场管制员信息变量


        while (flag) {
            UserInterface MainUserInterface = new UserInterface();//初始化用户接口
            String IsUserWannaExitInputer;//用户想退出系统的输入
            int IsUserWannaExit;//用户想退出系统嘛
            MainUserInterface.MainInUserInterface(AllOfFlights,AllOfFlightStatus,Airports);//调用用户接口
            /*如果执行到这里，用户应该是需要确认退出了*/
            System.out.println("确认退出此系统? y/n");
            Scanner UserInputer = new Scanner(System.in);
            IsUserWannaExitInputer = UserInputer.nextLine();
            UserInputIsSure IsSure = new UserInputIsSure();
            IsUserWannaExit = IsSure.YNIsSure(IsUserWannaExitInputer);
            /*无论如何。回收庞大的接口才是最重要的*/
            if (IsUserWannaExit == 1) {
                continue;
            } else if (IsUserWannaExit == 0) {
                //退出
                MainUserInterface = null;
                UserInputer = null;
                return true;
            }
        }
        return true;
    }
}
